/***********************************************************************
 * Module:  NhaBep.cs
 * Author:  Tuan Nguyen
 * Purpose: Definition of the Class NhaBep
 ***********************************************************************/

using System;

public class NhaBep
{
   public string TenPhongBan;
   public string DiaChiPhongBan;
   public string DienThoaiPhong;
   public string TenNhaBep;
   
   public System.Collections.ArrayList chiTietKhoThanhPham;
   
   /// <pdGenerated>default getter</pdGenerated>
   public System.Collections.ArrayList GetChiTietKhoThanhPham()
   {
      if (chiTietKhoThanhPham == null)
         chiTietKhoThanhPham = new System.Collections.ArrayList();
      return chiTietKhoThanhPham;
   }
   
   /// <pdGenerated>default setter</pdGenerated>
   public void SetChiTietKhoThanhPham(System.Collections.ArrayList newChiTietKhoThanhPham)
   {
      RemoveAllChiTietKhoThanhPham();
      foreach (ChiTietKhoThanhPham oChiTietKhoThanhPham in newChiTietKhoThanhPham)
         AddChiTietKhoThanhPham(oChiTietKhoThanhPham);
   }
   
   /// <pdGenerated>default Add</pdGenerated>
   public void AddChiTietKhoThanhPham(ChiTietKhoThanhPham newChiTietKhoThanhPham)
   {
      if (newChiTietKhoThanhPham == null)
         return;
      if (this.chiTietKhoThanhPham == null)
         this.chiTietKhoThanhPham = new System.Collections.ArrayList();
      if (!this.chiTietKhoThanhPham.Contains(newChiTietKhoThanhPham))
      {
         this.chiTietKhoThanhPham.Add(newChiTietKhoThanhPham);
         newChiTietKhoThanhPham.SetNhaBep(this);      
      }
   }
   
   /// <pdGenerated>default Remove</pdGenerated>
   public void RemoveChiTietKhoThanhPham(ChiTietKhoThanhPham oldChiTietKhoThanhPham)
   {
      if (oldChiTietKhoThanhPham == null)
         return;
      if (this.chiTietKhoThanhPham != null)
         if (this.chiTietKhoThanhPham.Contains(oldChiTietKhoThanhPham))
         {
            this.chiTietKhoThanhPham.Remove(oldChiTietKhoThanhPham);
            oldChiTietKhoThanhPham.SetNhaBep((NhaBep)null);
         }
   }
   
   /// <pdGenerated>default removeAll</pdGenerated>
   public void RemoveAllChiTietKhoThanhPham()
   {
      if (chiTietKhoThanhPham != null)
      {
         System.Collections.ArrayList tmpChiTietKhoThanhPham = new System.Collections.ArrayList();
         foreach (ChiTietKhoThanhPham oldChiTietKhoThanhPham in chiTietKhoThanhPham)
            tmpChiTietKhoThanhPham.Add(oldChiTietKhoThanhPham);
         chiTietKhoThanhPham.Clear();
         foreach (ChiTietKhoThanhPham oldChiTietKhoThanhPham in tmpChiTietKhoThanhPham)
            oldChiTietKhoThanhPham.SetNhaBep((NhaBep)null);
         tmpChiTietKhoThanhPham.Clear();
      }
   }
   public System.Collections.ArrayList ChiTietKhoSpdd;
   public PhongBan phongBan;
   
   /// <pdGenerated>default parent getter</pdGenerated>
   public PhongBan GetPhongBan()
   {
      return phongBan;
   }
   
   /// <pdGenerated>default parent setter</pdGenerated>
   /// <param>newPhongBan</param>
   public void SetPhongBan(PhongBan newPhongBan)
   {
      if (this.phongBan != newPhongBan)
      {
         if (this.phongBan != null)
         {
            PhongBan oldPhongBan = this.phongBan;
            this.phongBan = null;
            oldPhongBan.RemoveNhaBep(this);
         }
         if (newPhongBan != null)
         {
            this.phongBan = newPhongBan;
            this.phongBan.AddNhaBep(this);
         }
      }
   }

}